(require 'cl)
(require 'cl)
;------ For emacs 24, remove make-local-hook------------
(defalias 'make-local-hook
    'ignore)

;------ system setting --------------------------------
(mouse-avoidance-mode 'animate)
(setq default-major-mode 'text-mode)
(column-number-mode 1)
(tool-bar-mode -1) 
(menu-bar-mode -1)
(setq inhibit-startup-message t)
(fset 'yes-or-no-p 'y-or-n-p)
(setq frame-title-format "emacs@%b")
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(scroll-bar-mode 0)
(setq display-time-24hr-format t)
(display-time-mode t)
(show-paren-mode -1)

;------ Backup files ----------------------------------
(setq version-control t)
(setq kept-old-versions 5)
(setq gdb-show-main t)
(setq kept-new-versions 10)
(setq delete-old-versions t)
(setq backup-directory-alist '(("." . "~/.emacs.d/.Backup")))
(setq backup-by-copying t)
(setq scroll-margin 3
      scroll-conservatively 10000)
(setq mouse-yank-at-point t)
(setq-default ispell-program-name "aspell")

(desktop-save-mode 0)
;(desktop-read)

;------ Plugins: session, ibuffer, tabbar, ido, and dired ----
(require 'ibuffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(add-hook 'ibuffer-mode-hook
            (lambda ()
              (setq ibuffer-filter-groups
                    '(
                      ("latex" (mode . latex-mode))
		      ("org" (mode . org-mode))
		      ("fortran" (mode . fortran-mode))
		      ("*buffer*" (name . "\\*.*\\*"))
;                      ("TAGS" (name . "^TAGS\\(<[0-9]+>\\)?$"))
                      ("dired" (mode . dired-mode))
		      ("elisp" (or (mode . emacs-lisp-mode)
                                   (mode . lisp-interaction-mode)))
                      ))))
;tabbar
(require 'ido)
(ido-mode t)

(provide 'startup_daemon)

